package dataContracts;

import java.io.File;
import java.io.Serializable;

import util.ChecksumHelper;

public abstract class SharedFile implements Serializable {
	protected File _fileRef; 
	
	SharedFile(String filePath) {
		this(new File(filePath));
	}
	
	public SharedFile(File file) {
		fullPath = file.getPath();
		_fileRef = file;
		
		setName(_fileRef.getName());
		setChecksum(ChecksumHelper.GetChecksum(_fileRef));
	}
	
	String fullPath;
	public String getFullPath() {
		return fullPath;
	}

	String name;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	String description;
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}

	String owner;
	public String getOwner() {
		return owner;
	}
	public void setOwner(String owner) {
		this.owner = owner;
	}

	String checksum;
	public String getChecksum() {
		return checksum;
	}
	public void setChecksum(String checksum) {
		this.checksum = checksum;
	}

	boolean isLocked;
	public boolean isIsLocked() {
		return isLocked;
	}
	public void Lock() {
		this.isLocked = true;
	}
	
	public File getFileReference() {
		return _fileRef;
	}

}